import got from "got";
import { readFileByType } from "../../utils/util";

const prefixUrl = process.env.IEP_PREFIXURL;
const suffixUrl = '/fams/total'

const authorization = readFileByType('iep_access_token')

const showMoney = async (token: string = "") => {
  try {
    const headers = {
      authorization: `Bearer ${token ?? authorization}`
    }
    const url = `${prefixUrl}${suffixUrl}`
    const res = await got.get(url, {
      headers,
    })
    const json = JSON.parse(res.body);
    console.log(json.data);
  } catch (error) {
    console.log(error);
  }
}

export { showMoney }